# 使用Java 21作为基础镜像
FROM openjdk:21-jre-slim

# 设置工作目录
WORKDIR /app

# 创建日志目录
RUN mkdir -p /app/logs

# 复制所有jar包
COPY gate-server/target/gate-server-1.0.0.jar .
COPY scene-server/target/scene-server-1.0.0.jar .
COPY login-server/target/login-server-1.0.0.jar .
COPY central-server/target/central-server-1.0.0.jar .
COPY balance-server/target/balance-server-1.0.0.jar .
COPY scripts/shell/start-all.sh .
COPY scripts/shell/stop-all.sh .

# 暴露端口
EXPOSE 8081 8082 8083 8084 8085

# 设置权限
RUN chmod +x start-all.sh
RUN chmod +x stop-all.sh

# 启动脚本
CMD ["./start-all.sh"]